<?php

namespace app\admin\model;

use think\Model;

class User extends Model
{
    protected $schema = [
        'id' => 'int',
        'nickname' => 'string',
        'avatar' => 'string',
        'gender' => 'boolean',
        'phone' => 'string',
        'password' => 'string',
        'status' => 'int',
        'create_time' => 'timestamp',
        'update_time' => 'timestamp',
    ];

    public function setPasswordAttr($value)
    {
        return password_hash($value,PASSWORD_DEFAULT);
    }
}